home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
programs
/
startmenu
/
extras
/
smrexx
/
readme
< prev
next >
Wrap
Text File
|
1996-04-13
|
4KB
|
125 lines
SMRexx - ARexx interface to StartMenu (v2.0 required)
SMRexx is a stand-alone program that opens an ARexx port named
"START_REXX". ARexx scripts can access this port to add buttons
to StartMenu's TaskBar.
SMRexx requires the "easyrexx.library" be copied to your LIBS: drawer.
easyrexx.library is copyrighted 1994, 1995 to Ketil Hunn.
USAGE:
The simplest method is to put SMRexx into StartMenu's StartUp
drawer so that SMRexx is automatically run whenever StartMenu
runs.
After it has loaded, it just sits around waiting for ARexx programs
to access its port.
To quit SMRexx, either send it CTRL-C or, quit StartMenu
COMMANDS
SMRexx currently only accepts five commands:
Command Template
------- --------
ADD_TASKBAR PORT/A,NAME/A,TEXT/K,IFF/K,ICON/K ;Make Taskbar button
ADD_CLOCK PORT/A,NAME/A,IFF/K,ICON/K ;Make clock button
REM_TASKBAR NAME/A ;Remove Taskbar button
REM_CLOCK NAME/A ;Remove clock button
TOGGLE NAME/A ;Toggle state of button
The Arguments are:
PORT - (REQUIRED) It must be the name of an ARexx port created by
your script
NAME - (REQUIRED) This will be the button's identifier.
TEXT - (NOT REQUIRED) For Taskbar buttons only. The text inside the
button.
IFF - (NOT REQUIRED) Full path/name of an IFF ILBM picture to use as
the icon.
ICON - (NOT REQUIRED) Full path/name of an program icon file who's
imagery will be used for the icon. NOTE: do not append the
".info" extension to the filename (i.e. "Sys:Utilities/Clock"
not "Sys:Utilities/Clock.info").
NOTES:
If you are creating a taskbar button you must supply one or more
of TEXT, IFF, ICON.
If you are creating a clock button you must supply either IFF or
ICON.
IFF and ICON are mutually exclusive. Only supply one or the other.
Taskbar buttons are TOGGLESELECT. Use the TOGGLE command to change the
state of a TaskBar button.
MESSAGES FROM SMRexx
SMRexx wiil send messages to your script in this format:
"id command"
Where "id" is the name of a gadget that you created and "command" is
either "HIT" or "REMOVE". You will receive the "HIT" command when
your button has been clicked and the "REMOVE" command when StartMenu
is quittong and needs to remove your button from the tasbar.
Example: if you create a button named "MY_BUTTON" SMRexx will send you
this message when your button is clicked:
"MY_BUTTON HIT"
(The quotes WILL NOT be part of the message)
STEPS FOR MAKING BUTTONS
To create a script, you would do the following steps:
1. Open the "rexxsupport.library"
AddLib('rexxsupport.library',0,-30,0)
2. Check to make sure SMRexx is running:
if (~Show('P', 'START_REXX')) then exit
3. Create an ARexx port:
if (~OpenPort(MY_PORT)) then exit
4. Create one or more buttons
/* Create a clock button */
address START_REXX ADD_CLOCK MY_PORT MY_BUTTON IFF=mypic.iff
5. Make sure the button was created:
if (0 ~= rc) then exit
6. Start an event loop, waiting for a button press:
do forever
WaitPkt(MY_PORT) /* Wait for message */
do forever
p = GetPkt(MY_PORT) /* Get the message */
if (0 == C2D(p)) then leave /* No more messages? */
arg = GetArg(p) /* Parse the message */
Reply(p, 0) /* Return message */
gad_id = SubWord(arg, 1, 1) /* Get the gadget id */
comnd = SubWord(arg, 2, 1) /* Get the command */
if (gad_id == MY_BUTTON) /* Check the id */
if ("HIT" == comnd) then do /* A button press */
/* Whatever */
end
else quitflag = 1 /* Must be REMOVE */
end
end
end
7. If you are terminating the script, remove the button. Do not
remove the button if you received a REMOVE message!
address START_REXX REM_CLOCK MY_BUTTON
8. Close your port
CosePort(MY_PORT)